﻿using HWmanagementDB;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;

namespace HWmanagementServer
{
    [DataContract]
    public class UserModel
    {
        [DataMember]
        public string Neptun;
        [DataMember]
        public string Name;
        [DataMember]
        public string Email;
        [DataMember]
        public string Password;
        [DataMember]
        public int Rank;

        public static USER toDBTable(UserModel um)
        {
            return new USER() { EMAIL = um.Email, NAME = um.Name, RANK = um.Rank, NEPTUN = um.Neptun, PASSWD = um.Password };
        }

        public static UserModel fromDBTable(USER u)
        {
            return new UserModel() { Email = u.EMAIL, Name = u.NAME, Rank = u.RANK, Neptun = u.NEPTUN };
        }

    }
}
